package com.tiansu.reborn.wanda.modules.executor.controller;

import com.tiansu.reborn.wanda.modules.executor.entity.ExamineEntity;
import com.tiansu.reborn.wanda.modules.executor.entity.result.ExamineResult;
import com.tiansu.reborn.wanda.modules.executor.entity.vo.ExamineChangeVo;
import com.tiansu.reborn.wanda.modules.executor.entity.vo.ExamineSelectVo;
import com.tiansu.reborn.wanda.modules.executor.service.ExamineService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class ExamineController {

    @Autowired
    private ExamineService examineService;

    @GetMapping("/examine")
    public String index() {
        return "examine";
    }

    @ResponseBody
    @PostMapping("show")
    public ExamineResult show(ExamineSelectVo vo){
        return examineService.getShowData(vo);
    }

    @ResponseBody
    @PostMapping("update")
    public String update(ExamineChangeVo vo){
        return examineService.updateData(vo);
    }

}
